3.316 \(\int \cot ^5(e+f x) (a+b \sec ^2(e+f x)) \, dx\)

Optimal. Leaf size=51 \[ -\frac{(a+b) \csc ^4(e+f x)}{4 f}+\frac{(2 a+b) \csc ^2(e+f x)}{2 f}+\frac{a \log (\sin (e+f x))}{f} \]

[Out]

((2*a + b)*Csc[e + f*x]^2)/(2*f) - ((a + b)*Csc[e + f*x]^4)/(4*f) + (a*Log[Sin[e + f*x]])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0714023, antiderivative size = 51, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 446, 77} \[ -\frac{(a+b) \csc ^4(e+f x)}{4 f}+\frac{(2 a+b) \csc ^2(e+f x)}{2 f}+\frac{a \log (\sin (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^5*(a + b*Sec[e + f*x]^2),x]

[Out]

((2*a + b)*Csc[e + f*x]^2)/(2*f) - ((a + b)*Csc[e + f*x]^4)/(4*f) + (a*Log[Sin[e + f*x]])/f

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin{align*} \int \cot ^5(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^3 \left (b+a x^2\right )}{\left (1-x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{x (b+a x)}{(1-x)^3} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{-a-b}{(-1+x)^3}+\frac{-2 a-b}{(-1+x)^2}-\frac{a}{-1+x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=\frac{(2 a+b) \csc ^2(e+f x)}{2 f}-\frac{(a+b) \csc ^4(e+f x)}{4 f}+\frac{a \log (\sin (e+f x))}{f}\\ \end{align*}

Mathematica [A]  time = 0.174829, size = 64, normalized size = 1.25 \[ \frac{a \left (-\cot ^4(e+f x)+2 \cot ^2(e+f x)+4 \log (\tan (e+f x))+4 \log (\cos (e+f x))\right )}{4 f}-\frac{b \cot ^4(e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^5*(a + b*Sec[e + f*x]^2),x]

[Out]

-(b*Cot[e + f*x]^4)/(4*f) + (a*(2*Cot[e + f*x]^2 - Cot[e + f*x]^4 + 4*Log[Cos[e + f*x]] + 4*Log[Tan[e + f*x]])
)/(4*f)

________________________________________________________________________________________

Maple [A]  time = 0.051, size = 64, normalized size = 1.3 \begin{align*} -{\frac{a \left ( \cot \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{ \left ( \cot \left ( fx+e \right ) \right ) ^{2}a}{2\,f}}+{\frac{a\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{b \left ( \cos \left ( fx+e \right ) \right ) ^{4}}{4\,f \left ( \sin \left ( fx+e \right ) \right ) ^{4}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^5*(a+b*sec(f*x+e)^2),x)

[Out]

-1/4/f*a*cot(f*x+e)^4+1/2/f*a*cot(f*x+e)^2+a*ln(sin(f*x+e))/f-1/4/f*b/sin(f*x+e)^4*cos(f*x+e)^4

________________________________________________________________________________________

Maxima [A]  time = 0.9878, size = 66, normalized size = 1.29 \begin{align*} \frac{2 \, a \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{2 \,{\left (2 \, a + b\right )} \sin \left (f x + e\right )^{2} - a - b}{\sin \left (f x + e\right )^{4}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/4*(2*a*log(sin(f*x + e)^2) + (2*(2*a + b)*sin(f*x + e)^2 - a - b)/sin(f*x + e)^4)/f

________________________________________________________________________________________

Fricas [A]  time = 0.551675, size = 215, normalized size = 4.22 \begin{align*} -\frac{2 \,{\left (2 \, a + b\right )} \cos \left (f x + e\right )^{2} - 4 \,{\left (a \cos \left (f x + e\right )^{4} - 2 \, a \cos \left (f x + e\right )^{2} + a\right )} \log \left (\frac{1}{2} \, \sin \left (f x + e\right )\right ) - 3 \, a - b}{4 \,{\left (f \cos \left (f x + e\right )^{4} - 2 \, f \cos \left (f x + e\right )^{2} + f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/4*(2*(2*a + b)*cos(f*x + e)^2 - 4*(a*cos(f*x + e)^4 - 2*a*cos(f*x + e)^2 + a)*log(1/2*sin(f*x + e)) - 3*a -
 b)/(f*cos(f*x + e)^4 - 2*f*cos(f*x + e)^2 + f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**5*(a+b*sec(f*x+e)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.49263, size = 339, normalized size = 6.65 \begin{align*} -\frac{64 \, a \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right ) - 32 \, a \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right ) + \frac{{\left (a + b + \frac{12 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{48 \, a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}} + \frac{12 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{4 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{64 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^5*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

-1/64*(64*a*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1) - 32*a*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1))
 + (a + b + 12*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 48*a*(cos
(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)^2/(cos(f*x + e) - 1)^2 + 12*a*(cos(f*x + e) - 1)/(co
s(f*x + e) + 1) + 4*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b*
(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/f